
// dto    是接收参数的
// entity 是和数据库表对应的
// vo     是封装返回的数据的

import { ApiProperty } from "@nestjs/swagger";


class UserInfo {
    @ApiProperty()
    id: number;

    @ApiProperty({example: 'zhangsan'})
    username: string;

    @ApiProperty({example: '张三'})
    nickName: string;

    @ApiProperty({example: 'xx@xx.com'})
    email: string;

    @ApiProperty({example: 'xxx.png'})
    headPic: string;

    @ApiProperty({example: '13233333333'})
    phoneNumber: string;

    @ApiProperty()
    isFrozen: boolean;

    @ApiProperty()
    isAdmin: boolean;

    @ApiProperty()
    createTime: number;

    @ApiProperty({example: ['管理员']})
    roles: string[];  //需自行组织的数据

    @ApiProperty({example: { "ccc": "访问 ccc 接口", "ddd": "访问 ddd 接口" } })
    permissions: {}   //需自行组织的数据
}


export class LoginUserVo {

    @ApiProperty()
    userInfo: UserInfo;

    @ApiProperty()
    accessToken: string;

    @ApiProperty()
    refreshToken: string;
}

